﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HF.Framework.DataClientDBAgent;
using HF.Framework;
using HF.Framework.SqlDataContract;

public partial class CompanyLinkManEdit : System.Web.UI.Page
{
    string userId = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (Request["UserId"] != null)
        {
            userId = Request["UserId"].ToString();
            if (!this.IsPostBack)
            {
                string sql = "select * from ArchDutyUserView where userId=@userId";
                SqlDataItem sqlItem = new SqlDataItem();
                sqlItem.CommandText = sql;
                sqlItem.AppendParameter("@userId", userId);
                ClientDBAgent agent = new ClientDBAgent();
                DataTable dt = agent.ExecuteDataTable(sqlItem);
                if (dt != null && dt.Rows.Count > 0)
                {
                    txtName.Text = dt.Rows[0]["UserName"].ToString();
                    txtDutyCaption.Text = dt.Rows[0]["DutyCaption"].ToString();
                    txtDepart.Text = dt.Rows[0]["UserDepart"].ToString();
                    txtTel.Text = dt.Rows[0]["UserTelephone"].ToString();
                    //txtMbtel.Text = dt.Rows[0]["Mbtel"].ToString();
                    txtFax.Text = dt.Rows[0]["UserFax"].ToString();
                    txtEmail.Text = dt.Rows[0]["UserEmail"].ToString();
                    txtQQ.Text = dt.Rows[0]["UserQQ"].ToString();
                    txtMsn.Text = dt.Rows[0]["UserMSN"].ToString();
                    tbxRemark.Text = dt.Rows[0]["UserDes"].ToString();
                    
                }
            }
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Write("<script>window.close()</script>");
    }
}
